public class ComponentProperty extends Object implements XMLMarshallable
Java class is a Helper class to marshal and unmarshal all the rating components.PropertyThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="componentPropertyType">
<xs:restriction base="xs:string">
<xs:enumeration value="number"/>
<xs:enumeration value="decimal"/>
<xs:enumeration value="string"/>
<xs:enumeration value="date"/>
<xs:enumeration value="money"/>
<xs:enumeration value="boolean"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="property">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="componentPropertyType"/>
<xs:attribute name="value" type="xs:string"/>
<xs:attribute name="propertyNameValue" type="xs:boolean" default="false"/>
</xs:complexType>
</xs:element>
| Type | Property and Description |
|---|---|
Property |
to
Convert the
ComponentProperty to a Property. |
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_BOOLEAN
Constant for property type boolean.
|
static int |
TYPE_DATE
Constant for property type date.
|
static int |
TYPE_MONEY
Constant for property type money.
|
static int |
TYPE_NUMBER
Constant for property type number.
|
static int |
TYPE_STRING
Constant for property type string.
|
| Constructor and Description |
|---|
ComponentProperty()
Constructs an empty component property.
|
ComponentProperty(String name,
int type,
Object value,
boolean isPropertyNameValue)
Build the ComponentProperty from the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
boolean |
getBooleanValue()
Returns the value of the component property as a boolean.
|
Date |
getDateValue()
Returns the value of the component property as a date.
|
BigDecimal |
getDecimalValue()
Returns the value of the component property as a decimal.
|
Money |
getMoneyValue()
Returns the value of the component property as a money.
|
String |
getName()
Returns the name of the component property.
|
String |
getPropertyNameValue()
Returns the value of the component property as a property name.
|
String |
getStringValue()
Returns the value of the component property as a string.
|
int |
getType()
Returns the type of the component property.
|
Object |
getValue()
Get the value of the component property as an object.
|
boolean |
isPropertyNameValue()
Whether the property value is a property name
|
void |
isPropertyNameValue(boolean isPropertyNameValue)
Set whether the component property is pointing to a property.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
marshal(XMLOutputter output,
String fullName) |
static void |
marshal(XMLOutputter output,
String name,
BigDecimal value)
Helper static method to marshall a component property of type decimal.
|
static void |
marshal(XMLOutputter output,
String name,
boolean value)
Helper static method to marshall a component property of type boolean.
|
static void |
marshal(XMLOutputter output,
String name,
Date value)
Helper static method to marshall a component property of type date.
|
static void |
marshal(XMLOutputter output,
String name,
Money value)
Helper static method to marshall a component property of type money.
|
static void |
marshal(XMLOutputter output,
String name,
String value)
Helper static method to marshall a component property of type string.
|
static void |
marshal(XMLOutputter output,
String name,
String value,
int type)
Helper static method to marshall a component property of any type with a value which is
a name property.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setBooleanValue(boolean booleanValue)
Set the value of the component property with a boolean.
|
void |
setDateValue(Date dateValue)
Set the value f the component property with a date.
|
void |
setDecimalValue(BigDecimal decimalValue)
Set the value of the component property with a decimal.
|
void |
setMoneyValue(Money moneyValue)
Set the value of the component property with a money.
|
void |
setName(String name)
Set the component property name.
|
void |
setPropertyNameValue(String propertyNameValue)
Set the value of the component property with a property name.
|
void |
setStringValue(String stringValue)
Set the value of the component property with a string.
|
void |
setType(int type)
Set the component property type.
|
void |
setValue(Object value)
Set the value of the component property with an object.
|
Property |
toProperty()
Convert the
ComponentProperty to a Property. |
static String |
translate(String propertyName)
Deprecated.
|
public Property toProperty
ComponentProperty to a Property.IllegalArgumentExceptionpublic static final int TYPE_STRING
public static final int TYPE_NUMBER
public static final int TYPE_DATE
public static final int TYPE_MONEY
public static final int TYPE_BOOLEAN
public ComponentProperty()
public String getName()
public void setName(String name)
name - The new name of the component propertypublic String getStringValue()
public void setStringValue(String stringValue)
stringValue - The value to set uppublic BigDecimal getDecimalValue()
public void setDecimalValue(BigDecimal decimalValue)
decimalValue - The value to set uppublic Date getDateValue()
public void setDateValue(Date dateValue)
dateValue - The value to set uppublic Money getMoneyValue()
public void setMoneyValue(Money moneyValue)
moneyValue - The value to set uppublic boolean getBooleanValue()
public void setBooleanValue(boolean booleanValue)
booleanValue - The value to set uppublic String getPropertyNameValue()
public void setPropertyNameValue(String propertyNameValue)
propertyNameValue - The value to set uppublic Object getValue()
public void setValue(Object value)
value - The value to set uppublic boolean isPropertyNameValue()
public void isPropertyNameValue(boolean isPropertyNameValue)
isPropertyNameValue - Whether the component property is pointing to a propertypublic int getType()
public void setType(int type)
type - The type to set uppublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output, String fullName)
public void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic static void marshal(XMLOutputter output, String name, String value)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the propertypublic static void marshal(XMLOutputter output, String name, Date value)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the propertypublic static void marshal(XMLOutputter output, String name, BigDecimal value)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the propertypublic static void marshal(XMLOutputter output, String name, Money value)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the propertypublic static void marshal(XMLOutputter output, String name, boolean value)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the propertypublic static void marshal(XMLOutputter output, String name, String value, int type)
output - The XML outputter where the output has to goname - The name of the propertyvalue - The value of the property (the property name to which the current property is pointing)type - The type of the property@Deprecated public static String translate(String propertyName)
propertyName - public Property toProperty() throws IllegalArgumentException
ComponentProperty to a Property.IllegalArgumentException